<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['prefix'=>'works'],function(){
    //首页广告
    Route::any('first.head','Work\WorksController@firstPageHead');
    //首页商品列表
    Route::any('first.list','Work\WorksController@firstPageRecmdGoods');
    //广告
    Route::get('first.ads','Work\WorksController@ads');
    //标签类型
    Route::get('first.label','Work\WorksController@label');
    //通知类型
    Route::get('first.notice','Work\WorksController@notice');
    //首页推荐
    Route::any('first.page','Work\WorksController@bestWorks');
    //商品页面
    Route::any('index','Work\WorksController@goodsIndex');

    //附近商品
    Route::any('near.goods','Work\WorksController@nearWorks');
	//分类页面
    Route::any('other.page','Work\WorksController@OtherArticleClassWorks');
    //点赞
    Route::any('praise','Work\WorksController@praise');
    //评论
    Route::any('comment','Work\WorksController@comment');
    //获得评论列表
    Route::any('comment.list','Work\WorksController@getCommentsList');
    //获得评论列表
    Route::any('comment.responce','Work\WorksController@getCommentsResponce');
	
	//获得单个文章
    Route::any('article.detail','Work\WorksController@getArticleDetail');
	
	//获得作者发布的文章
    Route::any('author.article','Work\WorksController@getMyArticle');
	
	//随便看看文章
	Route::any('rand.works','Work\WorksRelateController@randWorks');

    //发布商品
    Route::any('put.buys','Goods\GoodsController@putGoods');
	
	//举报商品
    Route::any('info.works','Work\WorksRelateController@informWorks');
	
	//增加商品阅读量
    Route::any('incr.reading','Work\WorksController@addReading');

    //上架下架商品
	Route::any('change.sale','Work\WorksRelateController@worksSale');
    //获得推荐数据
    Route::any('page.recmd','Work\WorksRelateController@worksRandRecmd');
});


Route::group((['prefix' => 'goods']),function (){
    //商品详情
    Route::any('detail','Goods\GoodsController@goodsDetail');
    //商品评价详情列表
    Route::any('comment.list','Goods\GoodsController@goodsCommentList');
    //商品评价
    Route::any('comment','Goods\GoodsController@commentGoods');
});


Route::group(['prefix' => 'cart'],function (){
    //加入购物车
    Route::any('put.into','Cart\CartController@putIntoCart');
    //购物车列表
    Route::any('list','Cart\CartController@cartList');
    //删除购物车商品
    Route::any('del','Cart\CartController@delSomeCart');
    //清空购物车
    Route::any('empty','Cart\CartController@delAllCart');
    //改变购物车商品数量
    Route::any('change.num','Cart\CartController@changeCartNum');
});


Route::group((['prefix'=>'user']),function(){
    //登入
    Route::any('login','Customer\CustomerController@login');
    //第三方登入
    Route::any('oauth','Customer\CustomerController@oauth');
    //小程序登入
    Route::any('program/login','Customer\CustomerController@programLogin');
    //小程序注册
    Route::any('program/register','Customer\CustomerController@programRegister');
    //小程序token 检测
    Route::any('program/check-login','Customer\CustomerController@checkToken');
    //获取验证码
    Route::any('ecode','Customer\CustomerController@sendCode');
    //更改头像
    Route::any('headimg','Customer\CustomerController@changeHeadImg');
    //绑定手机号
    Route::post('mobile','Customer\CustomerController@changeMobile');
    //更改昵称
    Route::any('nickname','Customer\CustomerController@changeNickname');
    //重新设置密码
    Route::any('repwd','Customer\CustomerController@setPassword');
    //注册
    Route::any('register','Customer\CustomerController@register');
	//关注
    Route::any('follow','Customer\CustomerRelateController@followUser');
	//取消关注
	Route::any('cancle.follow','Customer\CustomerRelateController@cancleFollow');
	//关注作者文章
    Route::any('follow.article','Customer\CustomerRelateController@myFollowAuthoerArticle');
	//获得我的粉丝
	Route::any('user.fans','Customer\CustomerRelateController@myFans');
	//获取我的关注
	Route::any('user.follows','Customer\CustomerRelateController@myFollows');
	//系统推荐作者
	Route::any('author.recommend','Customer\CustomerRelateController@systemRecommendAuthor');
	//用户介绍
	Route::any('introduce','Customer\CustomerController@setIntroduce');

    //增加收货地址
    Route::any('create.address','Customer\CustomerRelateController@setShippingAddress');
    //编辑收货地址
    Route::any('change.address','Customer\CustomerRelateController@editAddress');
    //获得收货地址
    Route::get('get.address','Customer\CustomerRelateController@showMyAddress');
    //获得默认收货地址
    Route::get('default.address','Customer\CustomerRelateController@myDefaultAddress');
    //删除收货地址
    Route::any('del.address','Customer\CustomerRelateController@delAddress');
    //获得省市区
    Route::any('zd.address','Customer\CustomerRelateController@provincesCityArea');
    //设置默认地址
    Route::any('def.set','Customer\CustomerRelateController@setDefaultAddress');
    //收入明细
    Route::any('income.detail','Customer\CustomerRelateController@userBalanceLog');
	//我的收入总额
    Route::any('myincome','Myorders\OrderController@mySumIncome');

    //用户头像
    Route::any('user.head','Customer\CustomerController@getCustomerHeadimg');

    //快递单号
    Route::any('courier','System\SystemController@courierInfo');
    //获得用户信息
    Route::any('user.detail','Customer\CustomerController@userDetail');
});

//朋友圈
Route::group(['prefix' => 'friend'],function (){
    //朋友圈页面
    Route::any('first.page','Circle\CircleController@BestCirclePage');
	Route::any('my.circle','Circle\CircleController@getMyPushCircle');
    //发布朋友圈
    Route::any('push','Circle\CircleController@pushFriendCircle');
	//删除朋友圈动态
    Route::any('delete','Circle\CircleController@cancleFriendCircle');
    //点赞
    Route::any('praise','Circle\CircleController@friendCirclePraise');
    //评论
    Route::any('comment','Circle\CircleController@comment');
    //获得评论列表
    Route::any('comment.list','Circle\CircleController@getCommentsList');
    //获得评论列表
    Route::any('comment.responce','Circle\CircleController@getCommentsResponce');
	//附近求购
    Route::any('near.circle','Circle\CircleController@nearCircle');
	//增加求购阅读量
	Route::any('incr.reading','Circle\CircleController@addReading');
});

//订单
Route::group(['prefix'=>'order'],function (){
    //生成单个订单
    Route::post('/','Myorders\OrderController@createOrder');
    //订单确认页面
    Route::any('show.confirm','Myorders\OrderController@confirmOrder');
    //购物车订单确认页面
    Route::any('cart.confirm','Myorders\OrderController@cartConfirmOrder');
    //生成购物车订单
    Route::any('cart','Myorders\OrderController@createCartOrder');
    //充值生成订单
    Route::any('recharge','Myorders\OrderController@chargeCreateOrder');
    //卖家发货
    Route::any('send.goods','Myorders\OrderController@sellSendGoods');
    //买家确认收货
    Route::any('confirm.order','Myorders\OrderController@receiveGoods');
    //官方介入
    Route::any('plat.in','Myorders\OrderController@platInOrder');
    //订单明细
    Route::any('get.order','Myorders\OrderController@queryOrder');
	//订单明细
    Route::any('order.detail','Myorders\OrderController@orderDetail');
});

/**
 *  询价单
 */
Route::group(['prefix' => 'inquiry'], function() {
    //存储询价单
    Route::post('store','Inquiry\InquiryController@store');
    //询价单
    Route::get('index','Inquiry\InquiryController@index');
    //取消询价单
    Route::post('cancle','Inquiry\InquiryController@cancle');
    //询价单详情
    Route::get('detail','Inquiry\InquiryController@detail');
});

/**
 * 报价
 */
Route::group(['prefix' => 'quote'],function(){
    //存储报价单
    Route::post('store','Quote\QuoteController@store');
    //报价单列表
    Route::get('index','Quote\QuoteController@index');
    //修改报价

});
//消息
Route::group(['prefix' => 'msg'],function (){
    //获得消息列表
    Route::any('list','Imessage\MessageController@userMessageList');
    //获得消息详情
    Route::any('detail','Imessage\MessageController@userOutMessageDeatil');
    //去除离线消息
    Route::any('change','Imessage\MessageController@changeOut');
    //微信小程序模板消息
    Route::any('template-msg/put','Imessage\wxTemplate@sendTemplate');
});

Route::any('share','Share\ShareController@addShare');

//获得我的购买
Route::any('mybuy','Myorders\OrderController@myBuys');

//支付
Route::any('payment/unifiedOrder','Payment\PaymentController@unifiedOrder');
//支付宝回调
Route::any('payment/alipayNotify','Payment\PaymentController@alipayNotify');
//零钱支付
Route::any('payment/walletPay','Payment\PaymentController@walletOrder');
//微信支付
Route::any('payment/wxNotify','Payment\PaymentController@weixinNotify');


//激活码获得
Route::any('vcode','System\RegisterCodeController@verifyCode');

//激活码失效验证
Route::any('codevalid','System\RegisterCodeController@validCode');

Route::any('test','Work\WorksController@test');

Route::any('search','Search\SearchController@searchInfo');

//申请加入作者
Route::any('author/join.author','Author\AuthorController@joinAuthorGroup');
//申请加入进度查询
Route::any('author/join.status','Author\AuthorController@joinAuthorStatus');
//作者详情页
Route::any('author/author.detail','Author\AuthorController@authorDetailPage');
//个人主页
Route::any('author/my.detail','Author\AuthorController@myDetailPage');
//小程序个人主页
Route::any('/program/my.detail','Author\AuthorController@myProgramDetailPage');

Route::any('system/contact','System\SystemController@ideaFeedBack')->middleware('sign');

Route::any('search/recommend','Search\SearchController@searchRecommend');

//版本号
Route::any('version','System\SystemController@appVersion');

//七牛获得token
Route::any('system/token','System\SystemController@QiniuUploadToken');

//关注
//Route::any('follow','Customer\CustomerRelateController@followUser');

//取消关注
//Route::any('cancle.follow','Customer\CustomerRelateController@cancleFollow');
//删除朋友圈动态
//Route::any('delete','Circle\CircleController@cancleFriendCircle');
//关注作者文章
//Route::any('follow.article','Customer\CustomerRelateController@myFollowAuthoerArticle');


Route::any('xcx/friend.page','Circle\CircleController@xcxCirclePage');
Route::any('xcx/first.page','Work\WorksController@xcxFirstPage');
Route::any('xcx/article.detail','Work\WorksController@xcxArticleDetail');
Route::any('xcx/search','Search\SearchController@xcxSearchInfo');
